import { createRouter, createWebHistory } from 'vue-router'
import Index from "@/views/index.vue"


export const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "/",
      redirect: '/home',
      component: Index,
      children: [{
        path: "/home",
        name: "/home",
        component: () => import("@/views/home.vue"),
        meta: { title: "首页" }
      }, {
        path: "/movie",
        name: "/movie",
        component: () => import("@/views/movie.vue"),
        meta: { title: "电影" }
      }, {
        path: "/cinema",
        name: "/cinema",
        component: () => import("@/views/cinema.vue"),
        meta: { title: "影院" }
      }, {
        path: "/rank",
        name: "/rank",
        component: () => import("@/views/rank.vue"),
        meta: { title: "排行榜" }
      },]
    }, {
      path: "/login",
      name: "/login",
      component: () => import("@/views/login.vue"),
      meta: { title: "登录" }
    }, {
      path: "/center",
      name: "/center",
      component: () => import("@/views/center.vue"),
      meta: { title: "我的" }
    }
  ]
})